<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHouserScoresTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('houser_scores', function (Blueprint $table) {
            $table->id();
            $table->integer('house_id');
            $table->integer('user_id')->comment('评分用户');
            $table->float('synthetical_score')->comment('综合评分');
            $table->float('environment_score')->comment('环境评分');
            $table->float('service_score')->comment('服务评分');
            $table->string('remark')->nullable()->comment('备注');
            $table->integer('score_time')->comment('评分时间');
            $table->string('check_message')->nullable();
            $table->tinyInteger('check_status')->default(0);
            $table->index('house_id');
            $table->index('user_id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('houser_scores');
    }
}
